﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DestroiableWall : MonoBehaviour
{
    protected Animator anim;
    protected AudioSource destroyAudio;
    // Start is called before the first frame update
    protected virtual void Start()
    {
        anim = GetComponent<Animator>();
        destroyAudio = GetComponent<AudioSource>();
    }

    // Update is called once per frame
    public void DashOn()
    {
        GetComponent<Collider2D>().enabled = false;
        anim.SetTrigger("destroy");
        destroyAudio.Play();
    }
    public void Death()
    {
        Destroy(gameObject);
    }
}
